package com.atguigu.feign;


import com.atguigu.domain.Product;
import com.atguigu.feign.impl.OrderFeignImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


/*
* 使用OpenFeign实现远程接口调用
* value:是服务名称
* fallback:兜底实现类
* */
@FeignClient(value = "service-product",fallback = OrderFeignImpl.class)
public interface OrderFeign {
    @GetMapping("/api/product/{id}")
    Product getProductById(@PathVariable("id") String id);
}
